from flask import Flask
from flask_restful import Api, Resource, marshal_with

app = Flask(__name__)

api = Api(app)


class LoginView(Resource):
    resource_fields = {
        'username': 'xxxx',
        'content': 'give you any thing '
    }

    @marshal_with(resource_fields)
    def get(self):
        return {'username': 'hello world', 'content': 'hello'}


api.add_resource(LoginView, '/login')

if __name__ == '__main__':
    app.run(debug=True)
